<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">  
  <title>用户搜索</title>
 </head>
 <body>
 <form method="post" action="userdetail.php" enctype="multipart/form-data" >
 <?php 
  require_once('system/dbConnect.php');
   require_once('system/MyFunc.php');   
  connect();
  $sql = "select uid, uname, gender, birthdate, hobby, degree, intro, pic from users";
      if($_POST)
  {
	  $key = $_POST['key'];
	  $sql = $sql." where uname like '%{$key}%' ";
  }
  $result = fetch_array($sql);    
 ?>
 <table align="center" width="80%">
 <tr><td  align="left" >
 <form method=post action="">
    请输入用户名：
	<input type="text" name="key">
	<input type="submit" name='search' value="搜索">	
 </form> 
 </body>
</html>
